const stringUtil = {
    // 下划线转换驼峰
    toHump(name) {
        // eslint-disable-next-line no-useless-escape
        return name.replace(/\_(\w)/g, function (all, letter) {
            return letter.toUpperCase();
        });
    },
    // 驼峰转换下划线
    toLine(name) {
        return name.replace(/([A-Z])/g, "_$1").toLowerCase();
    }
}

export default stringUtil;